define(["../com"], function() {
	
	var satisfy = null;
	var soNbr = UrlParam.getParam("soNbr");
	
	$.post(g_domain + "/user/qryrepair?soNbr=" + soNbr, function(data) {
		if (data.status !== 0) {
			data.code == "0" ? void(0) : alert(data.message);
			return;
		}
		var apiData = $.parseJSON(data.result).response;
		$("#carNo").html(apiData[0].CarCardsNo);
		$("#voucherDate").html(apiData[0].VoucherDate);
	});

	$("#submit").click(function() {
		submit();
	});
	
	$("[type=radio]").click(function() {
		satisfy = $(this).val();
	});
	
	function submit() {
		if (!satisfy) {
			alert("请选择满意度");
			return;
		}
		var params = {
			soNbr: soNbr,
			satisfy: satisfy,
			remark: $("#remark").val()
		};
		$.post(g_domain + "/user/satisfy", params, function(data) {
			if (data.status !== 0) {
				alert(data.message);
				return;
			}
			alert("评价成功，非常感谢！");
			location.href="success.html";
		});
	}
	
});